package com.ss.android.m.a;

import static com.ss.android.video.SSMediaPlayerWrapper.CALLBACK_ON_BUFFERING_UPDATE;
import static com.ss.android.video.SSMediaPlayerWrapper.CALLBACK_ON_ERROR;

import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
import android.util.Log;

final class b extends Handler {
    private final a a;

    b(a arg1) {
        this.a = arg1;

    }

    public final void handleMessage(Message arg6) {
        HandlerThread v3 = null;
        super.handleMessage(arg6);
        a v1 = this.a;
        if(arg6 == null) {
            return;
        }

        Bundle v0 = arg6.getData();
        switch(arg6.what) {
            case 300: {
                v1.b();
                return;
            }
            case CALLBACK_ON_BUFFERING_UPDATE: {
                if(v1.p != null) {
                    Log.d(v1.p.a, "finishPause");
                }
                v1.a(207);
                return;
            }
            case 302: {
                if(v1.p == null) {
                    return;
                }
                Log.d(v1.p.a, "finishReset");
                return;
            }
            case CALLBACK_ON_ERROR: {
                if((v1.q) && v1.j != null) {
                    com.ss.android.m.c.aa v0_1 = v1.j;
                    if(v0_1.f != null && v0_1.f.getLooper() != null) {
                        try {
                            v0_1.f.getLooper().quit();
                        }
                        catch(Exception v2) {
                        }
                    }

                    if(v0_1.f == null) {
                    }else {
                        HandlerThread v2_1 = v0_1.f;
                        v0_1.f = v3;
                        v0_1.c = ((com.ss.android.m.c.a.a) null);
                        v0_1.d = ((Handler) null);
                        try {
                            ((Thread) v2_1).interrupt();
                        } catch (Exception v0_2) {
                        }
                    }
                }
                if(v1.p != null) {
                    Log.d(v1.p.a, "finishRelease");
                }

                v1.a(203);
                return;
            }
            case 304: {
                v1.j();
                return;
            }
            case 305: {
                if(v1.p != null) {
                    Log.d(v1.p.a, "finishStop");
                }
                v1.a(208);
                return;
            }
            case 306: {
                String v0_3 = v0.getString(a.l);
                if(v1.p != null) {
                    Log.d(v1.p.a, "finishSetData url = " + v0_3);
                }
                v1.a(202);
                return;
            }
            case 307: {
                if(v1.p != null) {
                    Log.d(v1.p.a, "finishSetDisplay");
                }
                v1.a(210);
                return;
            }
            case 308: {
                if(v1.p == null) {
                    return;
                }
                Log.d(v1.p.a, "finishSeekTo");
                return;
            }
            case 310: {
                v1.d();
                return;
            }
            case 311: {
                v1.b(arg6.arg1, arg6.arg2);
                return;
            }
            case 312: {
                v1.a(((long)arg6.arg1));
                return;
            }
            case 400: {
                v1.c(arg6.arg1, arg6.arg2);
                return;
            }
            case 401: {
                v1.a(v0.getInt(com.ss.android.m.a.a.m), (Exception) arg6.obj);
                return;
            }
        }

        return;














    }
}

